package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

/**
 * @Author Justin Parker
 * @Date 2024/7/17 0017 10:27
 * @Version 1.0
 */
public class InputStreamReaderDemo01 {
    public static void main(String[] args) throws IOException {
        //1.创建字符输入转换流对象
        InputStreamReader isr =
                new InputStreamReader(
                        new FileInputStream("./ow.txt"),
                        StandardCharsets.UTF_8);
        //2.读数据
        int data =0;
        while ((data = isr.read())!=-1){
            System.out.print((char)data);
        }
        //3.关闭流对象
        isr.close();

    }
}
